﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace XCommunity.Forums.Extension
{
  internal class UserCounter
  {

    private HashSet<string> _users = new HashSet<string>();

    public void Add( IIdentity user )
    {
      _users.Add( user.Name );
    }

    public int Count
    {
      get { return _users.Count; }
    }


    public override string ToString()
    {
      return Count.ToString();
    }

    public static implicit operator string[]( UserCounter counter )
    {
      return counter._users.ToArray();
    }


  }
}
